package com.zjhn.ds.utils;

import java.util.Comparator;

/**
 * @BelongsProject: ds_jlw
 * @BelongsPackage: com.zjhn.ds.utils
 * @Author: sxt
 * @CreateTime: 2023-12-12  14:04
 * @Description:
 * @Version: 1.0
 */
public class CustomComparator implements Comparator<String> {
    @Override
    public int compare(String s1, String s2) {
        String[] parts1 = s1.split("-");
        String[] parts2 = s2.split("-");

        int num1 = Integer.parseInt(parts1[0].substring(1) + parts1[1] + parts1[2]);
        int num2 = Integer.parseInt(parts2[0].substring(1) + parts2[1] + parts2[2]);

        return Integer.compare(num1, num2);
    }

}
